package com.sjsu.aws.groupmembership;

/**
 * 
 * @author Deepali Pawar
 * 
 */
public class GroupMemberShip {
	private String	uuid;
	private String	memberId;
	private String	groupId;
	private long	endTimestamp;
	
	public String getUuid() {
		return this.uuid;
	}
	
	public void setUuid(String uuid) {
		this.uuid = uuid;
	}
	
	public String getMemberId() {
		return this.memberId;
	}
	
	public void setMemberId(String memberId) {
		this.memberId = memberId;
	}
	
	public long getEndTimestamp() {
		return this.endTimestamp;
	}
	
	public void setEndTimestamp(long endTimestamp) {
		this.endTimestamp = endTimestamp;
	}
	
	public String getGroupId() {
		return groupId;
	}
	
	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
		        + (int) (this.endTimestamp ^ (this.endTimestamp >>> 32));
		result = prime * result
		        + ((this.groupId == null) ? 0 : this.groupId.hashCode());
		result = prime * result
		        + ((this.memberId == null) ? 0 : this.memberId.hashCode());
		result = prime * result
		        + ((this.uuid == null) ? 0 : this.uuid.hashCode());
		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		GroupMemberShip other = (GroupMemberShip) obj;
		if (this.endTimestamp != other.endTimestamp)
			return false;
		if (this.groupId == null) {
			if (other.groupId != null)
				return false;
		} else if (!this.groupId.equals(other.groupId))
			return false;
		if (this.memberId == null) {
			if (other.memberId != null)
				return false;
		} else if (!this.memberId.equals(other.memberId))
			return false;
		if (this.uuid == null) {
			if (other.uuid != null)
				return false;
		} else if (!this.uuid.equals(other.uuid))
			return false;
		return true;
	}
}
